﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace LyyCMS.Migrations
{
    public partial class update_article_cate : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<bool>(
                name: "IsDefault",
                table: "Site",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldNullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreatorUserId1",
                table: "ArticleCategory",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "DeleterUserId1",
                table: "ArticleCategory",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "LastModifierUserId1",
                table: "ArticleCategory",
                nullable: true);

            migrationBuilder.UpdateData(
                table: "Blogs",
                keyColumn: "Id",
                keyValue: 1,
                column: "Create_At",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 429, DateTimeKind.Local).AddTicks(374));

            migrationBuilder.UpdateData(
                table: "Blogs",
                keyColumn: "Id",
                keyValue: 2,
                column: "Create_At",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 429, DateTimeKind.Local).AddTicks(2872));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreationTime",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 424, DateTimeKind.Local).AddTicks(5449));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreationTime",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 424, DateTimeKind.Local).AddTicks(9208));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreationTime",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 424, DateTimeKind.Local).AddTicks(9269));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 4,
                column: "CreationTime",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 424, DateTimeKind.Local).AddTicks(9275));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 5,
                column: "CreationTime",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 424, DateTimeKind.Local).AddTicks(9280));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 6,
                column: "CreationTime",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 424, DateTimeKind.Local).AddTicks(9285));

            migrationBuilder.UpdateData(
                table: "Comments",
                keyColumn: "Id",
                keyValue: 1,
                column: "Create_At",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 430, DateTimeKind.Local).AddTicks(7569));

            migrationBuilder.UpdateData(
                table: "Comments",
                keyColumn: "Id",
                keyValue: 2,
                column: "Create_At",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 430, DateTimeKind.Local).AddTicks(8635));

            migrationBuilder.UpdateData(
                table: "Comments",
                keyColumn: "Id",
                keyValue: 3,
                column: "Create_At",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 430, DateTimeKind.Local).AddTicks(8651));

            migrationBuilder.UpdateData(
                table: "Comments",
                keyColumn: "Id",
                keyValue: 4,
                column: "Create_At",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 430, DateTimeKind.Local).AddTicks(8655));

            migrationBuilder.UpdateData(
                table: "Site",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreationTime",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 419, DateTimeKind.Local).AddTicks(2507));

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                column: "Crete_At",
                value: new DateTime(2019, 11, 11, 15, 48, 31, 428, DateTimeKind.Local).AddTicks(2491));

            migrationBuilder.CreateIndex(
                name: "IX_ArticleCategory_CreatorUserId1",
                table: "ArticleCategory",
                column: "CreatorUserId1");

            migrationBuilder.CreateIndex(
                name: "IX_ArticleCategory_DeleterUserId1",
                table: "ArticleCategory",
                column: "DeleterUserId1");

            migrationBuilder.CreateIndex(
                name: "IX_ArticleCategory_LastModifierUserId1",
                table: "ArticleCategory",
                column: "LastModifierUserId1");

            migrationBuilder.AddForeignKey(
                name: "FK_ArticleCategory_Users_CreatorUserId1",
                table: "ArticleCategory",
                column: "CreatorUserId1",
                principalTable: "Users",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_ArticleCategory_Users_DeleterUserId1",
                table: "ArticleCategory",
                column: "DeleterUserId1",
                principalTable: "Users",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);

            migrationBuilder.AddForeignKey(
                name: "FK_ArticleCategory_Users_LastModifierUserId1",
                table: "ArticleCategory",
                column: "LastModifierUserId1",
                principalTable: "Users",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_ArticleCategory_Users_CreatorUserId1",
                table: "ArticleCategory");

            migrationBuilder.DropForeignKey(
                name: "FK_ArticleCategory_Users_DeleterUserId1",
                table: "ArticleCategory");

            migrationBuilder.DropForeignKey(
                name: "FK_ArticleCategory_Users_LastModifierUserId1",
                table: "ArticleCategory");

            migrationBuilder.DropIndex(
                name: "IX_ArticleCategory_CreatorUserId1",
                table: "ArticleCategory");

            migrationBuilder.DropIndex(
                name: "IX_ArticleCategory_DeleterUserId1",
                table: "ArticleCategory");

            migrationBuilder.DropIndex(
                name: "IX_ArticleCategory_LastModifierUserId1",
                table: "ArticleCategory");

            migrationBuilder.DropColumn(
                name: "CreatorUserId1",
                table: "ArticleCategory");

            migrationBuilder.DropColumn(
                name: "DeleterUserId1",
                table: "ArticleCategory");

            migrationBuilder.DropColumn(
                name: "LastModifierUserId1",
                table: "ArticleCategory");

            migrationBuilder.AlterColumn<bool>(
                name: "IsDefault",
                table: "Site",
                type: "bit",
                nullable: true,
                oldClrType: typeof(bool),
                oldType: "bit");

            migrationBuilder.UpdateData(
                table: "Blogs",
                keyColumn: "Id",
                keyValue: 1,
                column: "Create_At",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 854, DateTimeKind.Local).AddTicks(5434));

            migrationBuilder.UpdateData(
                table: "Blogs",
                keyColumn: "Id",
                keyValue: 2,
                column: "Create_At",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 854, DateTimeKind.Local).AddTicks(5434));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreationTime",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 850, DateTimeKind.Local).AddTicks(5431));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 2,
                column: "CreationTime",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 851, DateTimeKind.Local).AddTicks(5432));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 3,
                column: "CreationTime",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 851, DateTimeKind.Local).AddTicks(5432));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 4,
                column: "CreationTime",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 851, DateTimeKind.Local).AddTicks(5432));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 5,
                column: "CreationTime",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 851, DateTimeKind.Local).AddTicks(5432));

            migrationBuilder.UpdateData(
                table: "Channels",
                keyColumn: "Id",
                keyValue: 6,
                column: "CreationTime",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 851, DateTimeKind.Local).AddTicks(5432));

            migrationBuilder.UpdateData(
                table: "Comments",
                keyColumn: "Id",
                keyValue: 1,
                column: "Create_At",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 855, DateTimeKind.Local).AddTicks(5434));

            migrationBuilder.UpdateData(
                table: "Comments",
                keyColumn: "Id",
                keyValue: 2,
                column: "Create_At",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 855, DateTimeKind.Local).AddTicks(5434));

            migrationBuilder.UpdateData(
                table: "Comments",
                keyColumn: "Id",
                keyValue: 3,
                column: "Create_At",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 855, DateTimeKind.Local).AddTicks(5434));

            migrationBuilder.UpdateData(
                table: "Comments",
                keyColumn: "Id",
                keyValue: 4,
                column: "Create_At",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 855, DateTimeKind.Local).AddTicks(5434));

            migrationBuilder.UpdateData(
                table: "Site",
                keyColumn: "Id",
                keyValue: 1,
                column: "CreationTime",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 846, DateTimeKind.Local).AddTicks(5429));

            migrationBuilder.UpdateData(
                table: "Users",
                keyColumn: "Id",
                keyValue: 1,
                column: "Crete_At",
                value: new DateTime(2019, 10, 24, 11, 50, 34, 853, DateTimeKind.Local).AddTicks(5433));
        }
    }
}
